# == Schema Information
# Schema version: 22
#
# Table name: friendships
#
#  id           :integer       not null, primary key
#  user_id      :integer       not null
#  friend_id    :integer       not null
#  requested_at :datetime      
#  accepted_at  :datetime      
#

class Friendship < ActiveRecord::Base
  belongs_to :friend, :class_name => "User", :foreign_key => "friend_id"
  belongs_to :user, :class_name => "User", :foreign_key => "user_id"
  validates_presence_of :user_id, :friend_id
  validates_uniqueness_of :friend_id, :scope => :user_id
end
